﻿using System.Collections.Generic;

namespace Citi.ReportManager.Domain
{
    public partial class Category
    {
        public IEnumerable<Category> GetAllChildren()
        {
            var categories = new List<Category> { this };

            foreach (var child in Children)
                categories.AddRange(child.GetAllChildren());

            return categories;
        }
    }
}